/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.gov.ana.entities;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author lucas.nunes
 */
@Entity
@Table(name = "QLTTB_STATUS_CONSISTENCIA")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "StatusConsistencia.findAll", query = "SELECT s FROM StatusConsistencia s"),
    @NamedQuery(name = "StatusConsistencia.findByStcId", query = "SELECT s FROM StatusConsistencia s WHERE s.stcId = :stcId"),
    @NamedQuery(name = "StatusConsistencia.findByStcNm", query = "SELECT s FROM StatusConsistencia s WHERE s.stcNm = :stcNm"),
    @NamedQuery(name = "StatusConsistencia.findByStcDs", query = "SELECT s FROM StatusConsistencia s WHERE s.stcDs = :stcDs")})
public class StatusConsistencia implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "STC_ID")
    private BigDecimal stcId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 104)
    @Column(name = "STC_NM")
    private String stcNm;
    @Size(max = 4000)
    @Column(name = "STC_DS")
    private String stcDs;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "mdhStcId")
    private List<MedHidrometeorologica> medHidrometeorologicaList;

    public StatusConsistencia() {
    }

    public StatusConsistencia(BigDecimal stcId) {
        this.stcId = stcId;
    }

    public StatusConsistencia(BigDecimal stcId, String stcNm) {
        this.stcId = stcId;
        this.stcNm = stcNm;
    }

    public BigDecimal getStcId() {
        return stcId;
    }

    public void setStcId(BigDecimal stcId) {
        this.stcId = stcId;
    }

    public String getStcNm() {
        return stcNm;
    }

    public void setStcNm(String stcNm) {
        this.stcNm = stcNm;
    }

    public String getStcDs() {
        return stcDs;
    }

    public void setStcDs(String stcDs) {
        this.stcDs = stcDs;
    }

    @XmlTransient
    public List<MedHidrometeorologica> getMedHidrometeorologicaList() {
        return medHidrometeorologicaList;
    }

    public void setMedHidrometeorologicaList(List<MedHidrometeorologica> medHidrometeorologicaList) {
        this.medHidrometeorologicaList = medHidrometeorologicaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (stcId != null ? stcId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof StatusConsistencia)) {
            return false;
        }
        StatusConsistencia other = (StatusConsistencia) object;
        if ((this.stcId == null && other.stcId != null) || (this.stcId != null && !this.stcId.equals(other.stcId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.gov.ana.service.StatusConsistencia[ stcId=" + stcId + " ]";
    }
    
}
